home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Franz PD / Franz PD Disk #067 (1990-04)(Amiga User Group Deutschland e.V.).zip / Franz PD Disk #067 (1990-04)(Amiga User Group Deutschland e.V.).adf / Include / StringLib.i < prev    next >
Text File  |  1989-07-02  |  4KB  |  182 lines

  1.  
  2. Function isupper(c : Char) : Boolean;
  3.     External;
  4. {
  5.     Returns True if the character is in A..Z
  6. }
  7.  
  8. Function islower(c : Char) : Boolean;
  9.     external;
  10. {
  11.     Returns True if the character is in a..z
  12. }
  13.  
  14. Function isalpha(c : Char) : Boolean;
  15.     external;
  16. {
  17.     Returns True if the character is in A..Z or a..z
  18. }
  19.  
  20. Function isdigit(c : Char) : Boolean;
  21.     external;
  22. {
  23.     Returns True if the character is in 0..9
  24. }
  25.  
  26. Function isalnum(c : Char) : Boolean;
  27.     external;
  28. {
  29.     Returns True if isalpha or isdigit is true
  30. }
  31.  
  32. Function isspace(c : Char) : Boolean;
  33.     external;
  34. {
  35.     Returns true if the character is "white space", like a space,
  36. form feed, line feed, carraige return, tab, whatever.
  37. }
  38.  
  39. Function toupper(c : Char) : Char;
  40.     external;
  41. {
  42.     If the character is in a..z, the function returns the capital.
  43. Otherwise it returns c.
  44. }
  45.  
  46. Function tolower(c : Char) : Char;
  47.     external;
  48. {
  49.     If c is in A..Z, the function returns the lower case letter.
  50. Otherwise it returns c.
  51. }
  52.  
  53. Function streq(s1, s2 : String) : Boolean;
  54.     external;
  55. {
  56.     Returns True if s1 and s2 are the same.
  57. }
  58.  
  59. Function strneq(s1, s2 : String; n : Short) : Boolean;
  60.     external;
  61. {
  62.     Returns True if the first n characters of s1 and s2 are identical.
  63. }
  64.  
  65. Function strieq(s1, s2 : String) : Boolean;
  66.     external;
  67. {
  68.     The same as streq(), but is case insensitive.
  69. }
  70.  
  71. Function strnieq(s1, s2 : String; n : Short) : Boolean;
  72.     external;
  73. {
  74.     The same as strneq(), but case insensitive.
  75. }
  76.  
  77. Function strcmp(s1, s2 : String) : Integer;
  78.     external;
  79. {
  80.     Returns an integer < 0 if s1 < s2, zero if they are equal, and > 0
  81. if s1 > s2.  Note that the returned values in 1.0 were always -1, 0 and 1;
  82. in version 1.1 that is no longer the case.
  83. }
  84.  
  85. Function stricmp(s1, s2 : String) : Integer;
  86.     external;
  87. {
  88.     The same as strcmp, but not case sensitive
  89. }
  90.  
  91. Function strncmp(s1, s2 : String; n : Short) : Integer;
  92.     external;
  93. {
  94.     Same as strcmp(), but only considers the first n characters.
  95. }
  96.  
  97. Function strnicmp(s1, s2 : String; n : Short) : Integer;
  98.     external;
  99. {
  100.     Same as strncmp, but not case sensitive
  101. }
  102.  
  103. Function strlen(s : String) : Integer;
  104.     external;
  105. {
  106.     Returns the number of characters in the string.  Note that you
  107. need strlen(s) + 1 bytes to hold the string, since the trailing zero is
  108. not counted in the length.
  109. }
  110.  
  111. Procedure strcpy(s1, s2 : String);
  112.     external;
  113. {
  114.     Copies s2 into s1, appending a trailing zero.  This is the same
  115. as C, but opposite from 1.0.  Sorry about that...
  116. }
  117.  
  118. Procedure strncpy(s1, s2 : String; n : Short);
  119.     external;
  120. {
  121.     Copies s2 into s1, with a maximum of n characters.  Appends a
  122. trailing zero.
  123. }
  124.  
  125. Procedure strcat(s1, s2 : String);
  126.     external;
  127. {
  128.     Appends s2 to the end of s1.
  129. }
  130.  
  131. Procedure strncat(s1, s2 : String; n : Short);
  132.     external;
  133. {
  134.     Appends at most n characters from s2 onto s1.
  135. }
  136.  
  137. Function strdup(s : String) : String;
  138.     External;
  139. {
  140.     This allocates a copy of the string 's', and returns a ptr
  141. }
  142.  
  143. Function strpos(s1 : String; c : Char) : Integer;
  144.     external;
  145. {
  146.     Return the position, starting at zero, of the first (leftmost)
  147. occurance of c in s1.  If there is no c, it returns -1.
  148. }
  149.  
  150. Function strrpos(s1 : String; c : Char) : Integer;
  151.     external;
  152. {
  153.     Returns the integer position of the right-most occurance of c in s1.
  154. If c is not in s1, it returns -1.
  155. }
  156.  
  157. Function Hash(s : String) : Short;
  158.     external;
  159. {
  160.     Returns the Hash value of s, computed like the AmigaDOS hash
  161. function.  You will have to cut this value (using AND or MOD) down to
  162. the size you need.
  163. }
  164.  
  165. Function AllocString(l : Integer) : String;
  166.     external;
  167. {
  168.     Allocates l bytes, and returns a pointer to the allocated memory.
  169. This memory is allocated through the new() function, so it will be returned
  170. to the system at the end of your program.  Note that the proper amount of RAM
  171. to allocate is strlen(s) + 1.
  172. }
  173.  
  174. Procedure FreeString(s : String);
  175.     external;
  176. {
  177.     This returns memory allocated by AllocString to the system.  Since
  178. the Amiga is a multitasking computer, you should always return memory you
  179. don't need to the system.
  180. }
  181.  
  182.